<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"> </script>
</head>
<body>
  <div id="app">
    {{ name }}
    <!-- 3使用组件 -->
    <hehe></hehe>
    <hehe></hehe>
  </div>

  <script>
    // 创建组件
   const first =  Vue.extend({
      // el:"xxx",
      // data: {}
      template: '<h1>你好世界</h1>',// 对应的是实例的el 
    })
    // 注册组件
    Vue.component("hehe",first)
    new Vue({
      el: "#app", 
      data: {     
        name: "韩梅梅"
      }
    })
  </script>
</body>
</html>